import path from "path";

/**
 * cgem.config.json的模型
 */
export = class Config{
    /** 控制器配置 */
    server = {
      host : "0.0.0.0",
      port : 8088
    };
    /** 特性配置 */
    features = {hotDeployment : true};
    /** 中间件配置 */
    middleware = {};
    /** 全局中间件配置 */
    global_middleware = [];
    /** 注解配置 */
    annotation = {
      // 挂载中间件
      Middleware:path.join(__dirname,"../annotation/Middleware"),
      // 挂载控制器
      Controller:path.join(__dirname,"../annotation/Controller"),
      // 挂载接口注解
      Annotation: path.join(__dirname,"../annotation/Annotation"),
      GetMapping: path.join(__dirname,"../annotation/GetMapping"),
      PostMapping: path.join(__dirname,"../annotation/PostMapping"),
      AnyMapping: path.join(__dirname,"../annotation/AnyMapping"),
      route_midd: path.join(__dirname,"../annotation/route_midd"),
      page_midd: path.join(__dirname,"../annotation/page_midd"),
      get: path.join(__dirname,"../annotation/auto_load_route"),
      post: path.join(__dirname,"../annotation/auto_load_route"),
      any: path.join( __dirname,"../annotation/auto_load_route"),
      midd: path.join(__dirname,"../annotation/auto_load_route"),
      end_controller: path.join(__dirname,"../annotation/auto_load_route")
    };
    /** 地址配置 */
    address = {
      // 资源文件的地址
      public: process.cwd()+"/public",

    };
    /** 运行注解的地址配置 */
    runAnnotation = [];
    /** 路由的配置 */
    routeConfig = [];
    /** 特殊路由配置 */
    special = {
      // 资源文件接口
      public: {
        path: path.join(__dirname,"../entrance/specialInterface/resourcesToRead"),
        middleware:[],
        parameter:[]
      },
      // 请求解析接口
      requestParse: {
        path: path.join(__dirname,"../entrance/specialInterface/requestParse"),
        middleware:[],
        parameter:[]
      },
      // 请求记录接口
      requestRecord: {
        path: path.join(__dirname,"../entrance/specialInterface/requestRecord"),
        middleware:[],
        parameter:[]
      },
      // 404找不到路由或资源接口
      404: {
        path: path.join( __dirname,"../entrance/specialInterface/404"),
        middleware:[],
        parameter:[]
      },
      // 服务器异常接口
      500: {
        path: path.join(__dirname,"../entrance/specialInterface/500"),
        middleware:[],
        parameter:[]
      },
    };
    /** 路径语法糖配置 */
    pathSugar = {
      //添加语法糖 资源文件路径
      "<public>": process.cwd()+"/public"
    };
    /** 模块配置 */
    modules = {};
    /** 插件配置 */
    plug = [];
}